﻿<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:Validation="clr-namespace:jSLCore.Client.Presentation.BaseControl.Validation"
             xmlns:Controls="clr-namespace:jSLCore.Client.Presentation.Controls"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:System="clr-namespace:System;assembly=mscorlib" mc:Ignorable="d"
             x:Class="jSLCore.Client.Presentation.ApplicationContainer.ApplicationContainer">
  <UserControl.Resources>
    <ResourceDictionary>
      <Storyboard x:Name="FadeInOut" x:Key="FadeInOut">
        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="fadeScreen"
                                       Storyboard.TargetProperty="(UIElement.Visibility)">
          <DiscreteObjectKeyFrame KeyTime="00:00:00">
            <DiscreteObjectKeyFrame.Value>
              <Visibility>Visible</Visibility>
            </DiscreteObjectKeyFrame.Value>
          </DiscreteObjectKeyFrame>
          <DiscreteObjectKeyFrame KeyTime="00:00:00.3000000">
            <DiscreteObjectKeyFrame.Value>
              <Visibility>Visible</Visibility>
            </DiscreteObjectKeyFrame.Value>
          </DiscreteObjectKeyFrame>
          <DiscreteObjectKeyFrame KeyTime="00:00:00.7000000">
            <DiscreteObjectKeyFrame.Value>
              <Visibility>Collapsed</Visibility>
            </DiscreteObjectKeyFrame.Value>
          </DiscreteObjectKeyFrame>
        </ObjectAnimationUsingKeyFrames>
        <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="fadeScreen"
                                      Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
          <EasingColorKeyFrame KeyTime="00:00:00" Value="#00000000">
            <EasingColorKeyFrame.EasingFunction>
              <CircleEase EasingMode="EaseInOut" />
            </EasingColorKeyFrame.EasingFunction>
          </EasingColorKeyFrame>
          <EasingColorKeyFrame KeyTime="00:00:00.3000000" Value="#A8000000">
            <EasingColorKeyFrame.EasingFunction>
              <CircleEase EasingMode="EaseInOut" />
            </EasingColorKeyFrame.EasingFunction>
          </EasingColorKeyFrame>
          <EasingColorKeyFrame KeyTime="00:00:00.7000000" Value="#01000000">
            <EasingColorKeyFrame.EasingFunction>
              <CircleEase EasingMode="EaseInOut" />
            </EasingColorKeyFrame.EasingFunction>
          </EasingColorKeyFrame>
        </ColorAnimationUsingKeyFrames>
        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="mainContent"
                                       Storyboard.TargetProperty="(UIElement.Visibility)">
          <DiscreteObjectKeyFrame KeyTime="00:00:00">
            <DiscreteObjectKeyFrame.Value>
              <Visibility>Collapsed</Visibility>
            </DiscreteObjectKeyFrame.Value>
          </DiscreteObjectKeyFrame>
          <DiscreteObjectKeyFrame KeyTime="00:00:00.3000000">
            <DiscreteObjectKeyFrame.Value>
              <Visibility>Visible</Visibility>
            </DiscreteObjectKeyFrame.Value>
          </DiscreteObjectKeyFrame>
        </ObjectAnimationUsingKeyFrames>
      </Storyboard>
      <Storyboard x:Name="dialogFadeIn" x:Key="dialogFadeIn">
        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000"
                                       Storyboard.TargetName="dialogContainer" Storyboard.TargetProperty="(UIElement.Visibility)">
          <DiscreteObjectKeyFrame KeyTime="00:00:00">
            <DiscreteObjectKeyFrame.Value>
              <Visibility>Visible</Visibility>
            </DiscreteObjectKeyFrame.Value>
          </DiscreteObjectKeyFrame>
        </ObjectAnimationUsingKeyFrames>
        <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="dialogContainer"
                                      Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
          <EasingColorKeyFrame KeyTime="00:00:00" Value="#00323232" />
          <EasingColorKeyFrame KeyTime="00:00:00.2000000" Value="#D7323232" />
        </ColorAnimationUsingKeyFrames>
        <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="dialogContainer"
                                      Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
          <EasingColorKeyFrame KeyTime="00:00:00" Value="#00000000" />
          <EasingColorKeyFrame KeyTime="00:00:00.2000000" Value="#DD000000" />
        </ColorAnimationUsingKeyFrames>
      </Storyboard>
      <Storyboard x:Name="dialogFadeOut" x:Key="dialogFadeOut">
        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="dialogContainer"
                                       Storyboard.TargetProperty="(UIElement.Visibility)">
          <DiscreteObjectKeyFrame KeyTime="00:00:00">
            <DiscreteObjectKeyFrame.Value>
              <Visibility>Visible</Visibility>
            </DiscreteObjectKeyFrame.Value>
          </DiscreteObjectKeyFrame>
          <DiscreteObjectKeyFrame KeyTime="00:00:00.2000000">
            <DiscreteObjectKeyFrame.Value>
              <Visibility>Collapsed</Visibility>
            </DiscreteObjectKeyFrame.Value>
          </DiscreteObjectKeyFrame>
        </ObjectAnimationUsingKeyFrames>
        <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="dialogContainer"
                                      Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
          <EasingColorKeyFrame KeyTime="00:00:00" Value="#C50E0E0E" />
          <EasingColorKeyFrame KeyTime="00:00:00.2000000" Value="#1A0E0E0E" />
        </ColorAnimationUsingKeyFrames>
        <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="dialogContainer"
                                      Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
          <EasingColorKeyFrame KeyTime="00:00:00" Value="#D2000000" />
          <EasingColorKeyFrame KeyTime="00:00:00.2000000" Value="#00000000" />
        </ColorAnimationUsingKeyFrames>
      </Storyboard>
    </ResourceDictionary>
  </UserControl.Resources>
  <Grid x:Name="LayoutRoot">
    <VisualStateManager.VisualStateGroups>
      <VisualStateGroup x:Name="SplashScreenStates">
        <VisualStateGroup.Transitions>
          <VisualTransition GeneratedDuration="0:0:0.1" />
          <VisualTransition From="SplashScreenVisible" GeneratedDuration="0:0:0.1" To="SplashScreenInvisible">
            <VisualTransition.GeneratedEasingFunction>
              <ExponentialEase EasingMode="EaseIn" Exponent="51" />
            </VisualTransition.GeneratedEasingFunction>
          </VisualTransition>
          <VisualTransition From="SplashScreenInvisible" GeneratedDuration="0:0:0.1" To="SplashScreenVisible">
            <VisualTransition.GeneratedEasingFunction>
              <CircleEase EasingMode="EaseInOut" />
            </VisualTransition.GeneratedEasingFunction>
          </VisualTransition>
        </VisualStateGroup.Transitions>
        <VisualState x:Name="SplashScreenVisible">
          <Storyboard>
            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)"
                             Storyboard.TargetName="splashScreen" d:IsOptimized="True" />
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.IsHitTestVisible)"
                                           Storyboard.TargetName="splashScreen">
              <DiscreteObjectKeyFrame KeyTime="0">
                <DiscreteObjectKeyFrame.Value>
                  <System:Boolean>True</System:Boolean>
                </DiscreteObjectKeyFrame.Value>
              </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
          </Storyboard>
        </VisualState>
        <VisualState x:Name="SplashScreenInvisible">
          <Storyboard Completed="splashScreenHide_Completed">
            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)"
                             Storyboard.TargetName="splashScreen" d:IsOptimized="True">
              <DoubleAnimation.EasingFunction>
                <QuinticEase EasingMode="EaseIn" />
              </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.IsHitTestVisible)"
                                           Storyboard.TargetName="splashScreen">
              <DiscreteObjectKeyFrame KeyTime="0">
                <DiscreteObjectKeyFrame.Value>
                  <System:Boolean>False</System:Boolean>
                </DiscreteObjectKeyFrame.Value>
              </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
          </Storyboard>
        </VisualState>
      </VisualStateGroup>
    </VisualStateManager.VisualStateGroups>
    <UserControl x:Name="mainContent">
    </UserControl>
    <Grid x:Name="dialogContainer" Visibility="Collapsed" Opacity="0">
      <Grid.Background>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
          <GradientStop Color="Black" Offset="0" />
          <GradientStop Color="White" Offset="1" />
        </LinearGradientBrush>
      </Grid.Background>
      <Grid x:Name="dlgPlusHeader">
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto" />
          <RowDefinition />
        </Grid.RowDefinitions>
        <Controls:ImageHeader x:Name="dlgHeader" Width="240" Margin="50,10,0,0" HorizontalAlignment="Left"
                              Grid.Row="0" Visibility="Collapsed" />
        <Border Margin="30" x:Name="dialogBorder" Grid.Row="1">
          <ScrollViewer x:Name="dialogScroll" HorizontalScrollBarVisibility="Disabled"
                        VerticalScrollBarVisibility="Disabled">
            <Grid>
              <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="auto" />
              </Grid.RowDefinitions>
              <Validation:OkCancelControl Grid.Row="1" x:Name="okCancel" OkClicked="dialogOk_Clicked"
                                          CancelClicked="dialogCancel_Clicked" KeyUp="okCancel_Key" VerticalAlignment="Center" />
              <Grid x:Name="dialogGrid" SizeChanged="dialogContentSizeChanged" Grid.Row="0" />
            </Grid>
          </ScrollViewer>
        </Border>
        <Controls:jSLCloseDialogButton Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Top"
                                       Width="40" Height="40" x:Name="upperCloseButton" Click="upperCloseDialog_Clicked" Cursor="Hand">
          <Controls:jSLCloseDialogButton.RenderTransform>
            <TranslateTransform X="-40" Y="6" />
          </Controls:jSLCloseDialogButton.RenderTransform>
        </Controls:jSLCloseDialogButton>
      </Grid>
    </Grid>
    <Grid x:Name="splashScreen" Opacity="0" IsHitTestVisible="False" d:IsHidden="True">
      <Controls:jSplashScreen />
    </Grid>
    <Grid x:Name="fadeScreen" Background="Black" Visibility="Collapsed" d:IsHidden="True" />
  </Grid>
</UserControl>